package com.mindata.blockchain.core.manager;

import com.mindata.blockchain.core.model.MessageEntity;
import com.mindata.blockchain.core.model.OrderTrackEntity;
import com.mindata.blockchain.core.repository.OrderTrackRepository;
import org.springframework.stereotype.Component;

import javax.annotation.Resource;
import java.util.List;
import java.util.stream.Collectors;

/**
 * @filename: OrderTrackManager.java
 * @author: coulson
 */
@Component
public class OrderTrackManager {

    @Resource
    private OrderTrackRepository orderTrackRepository;

    public OrderTrackEntity insertOrderTrack(OrderTrackEntity orderTrack) {
        return orderTrackRepository.save(orderTrack);
    }

    public List<OrderTrackEntity> findAll() {
        return orderTrackRepository.findAll();
    }

    public List<OrderTrackEntity> findByOrderId(String orderId) {
        return orderTrackRepository.findAllByOrderId(orderId);
    }
}

